package com.lk.lkappearance.model;

import java.io.Serializable;

/**
 * device
 * @author 
 */
public class Device implements Serializable {
    /**
     * 设备id
     */
    private String deviceId;

    /**
     * 设备名称,采集站名称或串口服务器名称或仪表
     */
    private String deviceName;

    /**
     * 父设备名称,采集站名称或pspace或串口服务器
     */
    private String parentDeviceName;

    /**
     * 瞬时流量位号1
     */
    private String oneTagName;

    /**
     * 瞬时流量位号2
     */
    private String twoTagName;

    /**
     * 瞬时流量位号3
     */
    private String threeTagName;

    private static final long serialVersionUID = 1L;

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getParentDeviceName() {
        return parentDeviceName;
    }

    public void setParentDeviceName(String parentDeviceName) {
        this.parentDeviceName = parentDeviceName;
    }

    public String getOneTagName() {
        return oneTagName;
    }

    public void setOneTagName(String oneTagName) {
        this.oneTagName = oneTagName;
    }

    public String getTwoTagName() {
        return twoTagName;
    }

    public void setTwoTagName(String twoTagName) {
        this.twoTagName = twoTagName;
    }

    public String getThreeTagName() {
        return threeTagName;
    }

    public void setThreeTagName(String threeTagName) {
        this.threeTagName = threeTagName;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Device other = (Device) that;
        return (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName()))
            && (this.getParentDeviceName() == null ? other.getParentDeviceName() == null : this.getParentDeviceName().equals(other.getParentDeviceName()))
            && (this.getOneTagName() == null ? other.getOneTagName() == null : this.getOneTagName().equals(other.getOneTagName()))
            && (this.getTwoTagName() == null ? other.getTwoTagName() == null : this.getTwoTagName().equals(other.getTwoTagName()))
            && (this.getThreeTagName() == null ? other.getThreeTagName() == null : this.getThreeTagName().equals(other.getThreeTagName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode());
        result = prime * result + ((getParentDeviceName() == null) ? 0 : getParentDeviceName().hashCode());
        result = prime * result + ((getOneTagName() == null) ? 0 : getOneTagName().hashCode());
        result = prime * result + ((getTwoTagName() == null) ? 0 : getTwoTagName().hashCode());
        result = prime * result + ((getThreeTagName() == null) ? 0 : getThreeTagName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", deviceId=").append(deviceId);
        sb.append(", deviceName=").append(deviceName);
        sb.append(", parentDeviceName=").append(parentDeviceName);
        sb.append(", oneTagName=").append(oneTagName);
        sb.append(", twoTagName=").append(twoTagName);
        sb.append(", threeTagName=").append(threeTagName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    public Device() {
    }

    public Device(String deviceId, String deviceName, String parentDeviceName, String oneTagName, String twoTagName, String threeTagName) {
        this.deviceId = deviceId;
        this.deviceName = deviceName;
        this.parentDeviceName = parentDeviceName;
        this.oneTagName = oneTagName;
        this.twoTagName = twoTagName;
        this.threeTagName = threeTagName;
    }
}